const router = require('koa-router')({
  prefix: '/lm'
})
const controllers = require('../controllers/index');
//首页相关的接口
router.get('/index/index',
  controllers.home.index
  //从数据库获取数据返回给前端
)
//分类相关的接口
router.get('/category/categoryNav',controllers.category.index.categoryNav)
router.get('/category/indexAction',controllers.category.index.indexAction)
router.get('/category/currentAction',controllers.category.index.currentAction)
//搜索相关的接口
router.get('/search/indexaction',controllers.search.index.indexAction)
router.post('/search/addhistoryaction', controllers.search.index.addHistoryAction)
//清除搜索历史记录
router.post('/search/clearhistoryaction',controllers.search.index.clearHistoryAction)
//搜索提示接口
router.get('/search/helperaction',controllers.search.index.helperAction)
//商品详情
router.get('/goods/detailaction',controllers.goods.index.detailAction)
router.get('/goods/goodsList',controllers.goods.index.goodsList)
//收藏相关的接口
router.post('/collect/addcollect',controllers.collect.index.addCollect)
//订单相关的接口
router.post('/order/submitAction',controllers.order.index.submitAction)
router.get('/order/detailAction',controllers.order.index.detailAction)
//购物车相关接口
router.post('/cart/addCart',controllers.cart.index.addCart)
router.get('/cart/cartList',controllers.cart.index.cartList)
//地址相关接口
router.get('/address/getListAction',controllers.address.index.getListAction)
router.get('/address/detailAction',controllers.address.index.detailAction)
router.post('/address/saveAction',controllers.address.index.saveAction)
//专题相关接口
router.get('/topic/listAction',controllers.topic.index.listAction)
router.get('/topic/detailAction',controllers.topic.index.detailAction)
module.exports = router